<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>首页</title>
</head>
<body>
<h1 align="center">这里是一个轮播图</h1>
<div sec:authorize="isAnonymous()">
    <h2 align="center"><span sec:authentication="name" style="color: green"></span>
        您好，您的权限为
        <span sec:authentication="principal.authorities" style="color: deepskyblue"></span>,
        您的权限： </h2>
    <form th:action="@{/logout}" method="post">
        <input th:type="submit" th:value="注销">
    </form>
</div>
<hr>
<div sec:authorize="hasRole('RELE_common')">
    <h3>学生</h3>
    <ul>
        <li><a th:href="@{/common/student}">student</a></li>
    </ul>
</div>

<div sec:authorize="hasRole('RELE_admin')">
    <h3>admin</h3>
    <ul>
        <li><a th:href="@{/admin/abnormal}">abnormal</a></li>
        <li><a th:href="@{/admin/user}">user</a></li>
    </ul>
</div>
</form>
</body>
</html>


